package com.bit.ioc.component;

import com.bit.ioc.model.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class StudentComponent {
    @Primary
    @Bean({"s3","s4"})
    public Student s1(){
        return new Student("zhansan",11);
    }
    @Bean({"s1","s2"})
    public Student s2(){
        return new Student("lisi",18);
    }
}
